#if($msg)
<script>
alert('$!msg');
</script>
#end
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>编辑文章</title>
<link href="/include/manage/images/main/style.css" rel="stylesheet" type="text/css" />
<link href="/include/manage/dialog/asyncbox.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="/ckeditor/ck_init.js"></script>
<script type="text/javascript" src="/include/manage/js/datepicker.js"></script>
<script type="text/javascript" src="/include/manage/js/jquery.js"></script>
<script type="text/javascript" src="/include/manage/js/AsyncBox.js"></script>
<script language="javascript">
jQuery.ajaxSetup ({  
	cache: false
});

$(function(){
	$('#chooseLinkType').click(function(){
		asyncbox.open({
			title : '选择其他分类',
			url : '/manage_type_ajax.ad?parameter=showList',
			width : 400,
			height : 300,
			tipsbar:{
				title : '选择其他分类',
				content : '文章可以同时引用到其他分类'
				},
		　　btnsbar : jQuery.btn.OKCANCEL,
		　　callback : function(action,iframe){
		　　　　　if(action == 'ok'){
		　　　　　　　var s='';
					var str='';
					$("input[name='sel_type']:checked",iframe.document.body).each(function(){
						s+=$(this).next().text()+",";
						str+=$(this).val()+",";
					});
					$("#showLinkTypes").val(s);
					$("#linkTypes").val(str);
		　　　　　}
		　　　}
		});
	});
	
	$('#chooseType').click(function(){
		asyncbox.open({
			title : '选择其他分类',
			url : '/manage_type_ajax.ad?parameter=showList',
			width : 400,
			height : 300,
			tipsbar:{
				title : '选择其他分类',
				content : '文章可以同时发布到其他分类'
				},
		　　btnsbar : jQuery.btn.OKCANCEL,
		　　callback : function(action,iframe){
		　　　　　if(action == 'ok'){
		　　　　　　　var s='';
					var str='';
					$("input[name='sel_type']:checked",iframe.document.body).each(function(){
						s+=$(this).next().text()+",";
						str+=$(this).val()+",";
					});
					$("#showOthers").val(s);
					$("#otherTypes").val(str);
		　　　　　}
		　　　}
		});
	});
});

function removeAttach(){
	asyncbox.confirm('注意：服务器上的附件文件本身也会随之删除，您确定要删除吗？','删除附件',function(action){
	　　　if(action == 'ok'){
			jQuery.get("/manage_news_ajax.ad" , { parameter : "removeAttach", id : "$!news.id" }, function(data){
				//zTree1.addNodes(zTree1.getSelectedNode(), [{ id:data,name:newtypename}]);
				$("#fileArea")[0].innerHTML="&nbsp; <input type=\"file\" name=\"uploadfile\" />";
			});
	　　　}
	});
}

function showAttach(){
	/*
	#if($fileType.equals("images.gif"))
	*/
	asyncbox.open({
		title : "预览附件",
		html : "<div align='center'><img id='imageView' src='$news.file' /></div>",
		width : 500,
		height : 400
　	});
	/*
	#end
	*/
}

function checkForm(){
	if($("#title").val().length==0){
		alert("标题不能为空！");
		$("#title")[0].focus();
		return false;
	}else if($("#type").val().length==0){
		alert("分类不能为空！");
		$("#type")[0].focus();
		return false;	
	}else if(CKEDITOR.instances.content.getData()==""){
		alert("内容不能为空！");
		$("#type")[0].focus();
		return false;	
	}
	return true;
}
</script>
<style>
#imageView { 
border:0; 
max-width:476px;
max-height:355px;
width:expression(this.width>476?'476px':this.width);
height:expression(this.height>355?'355px':this.height);
}
</style>
</head>
<body>
<form name="writeform" method="post" action="/manage_news.ad" enctype="multipart/form-data" onSubmit="return checkForm()">
<input type="hidden" name="parameter" value="$!action" />
<input type="hidden" name="id" id="id" value="$!news.id" />
<input type="hidden" name="order" #if($news.order) value="$!news.order"#else value="0"#end />
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="30" background="/include/manage/images/main/tab_05.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="12" height="30"><img src="/include/manage/images/main/tab_03.gif" width="12" height="30" /></td>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="46%" valign="middle"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="5%"><div align="center"><img src="/include/manage/images/main/tb.gif" width="16" height="16" /></div></td>
                <td width="95%"><span class="STYLE3">当前位置</span>：[内容管理]-[编辑缩略图]</td>
              </tr>
            </table></td>
            <td width="54%"><table border="0" align="right" cellpadding="0" cellspacing="0">
              <tr>
              #if($news.id)
				<td width="80"><table width="90%" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td><div align="center"><a href="/manage_pic.ad?newsid=$!news.id"><img src="/include/manage/images/main/22.gif" width="14" height="14" /></a></div></td>
                    <td><div align="center"><a href="/manage_pic.ad?newsid=$!news.id">管理图片</a></div></td>
                  </tr>
                </table></td>
              #end
                <td width="60"><table width="90%" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td><div align="center"><a href="/manage_news.ad?parameter=add&tid=#if($tid)$!tid#else$!news.type#end"><img src="/include/manage/images/main/22.gif" width="14" height="14" /></a></div></td>
                    <td><div align="center"><a href="/manage_news.ad?parameter=add&tid=#if($tid)$!tid#else$!news.type#end">新增</a></div></td>
                  </tr>
                </table></td>
                <td width="52"><table width="88%" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td><div align="center"><a href="/manage_news.ad?parameter=delete&id=$!news.id"><img src="/include/manage/images/main/11.gif" width="14" height="14" /></a></div></td>
                    <td><div align="center"><a href="/manage_news.ad?parameter=delete&id=$!news.id">删除</a></div></td>
                  </tr>
                </table></td>
              </tr>
            </table></td>
          </tr>
        </table></td>
        <td width="16"><img src="/include/manage/images/main/tab_07.gif" width="16" height="30" /></td>
      </tr>
    </table></td>
  </tr>
  <tr>
  	<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="8" background="/include/manage/images/main/tab_12.gif">&nbsp;</td>
        <td>
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="b5d6e6">
    <tr> 
      <td width="80" height="25" bgcolor="#ffffff">&nbsp;缩略图位置：</td>
      <td width="300" bgcolor="#ffffff">&nbsp;
      		<input type="file" name="uploadfile" />
      </td>
		
    </tr>
    <tr> 
 		<td height="25" bgcolor="#ffffff">&nbsp;缩略图链接：</td>
      <td bgcolor="#ffffff">&nbsp;
      	<input name="date" type="text" value="$!news.date" onFocus="HS_setDate(this)" />
      </td>
     
    </tr>
</table>
		</td>
        <td width="8" background="/include/manage/images/main/tab_15.gif">&nbsp;</td>
      </tr>
    </table></td>
    </tr>
  <tr>
    <td height="35" background="/include/manage/images/main/tab_19.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="12" height="35"><img src="/include/manage/images/main/tab_18.gif" width="12" height="35" /></td>
        <td valign="top"><div align="center"> 
          <input type="submit" name="Submit" value="确定">
          &nbsp; &nbsp; 
          <input type="reset" name="Reset" value="重写">
        </div></td>
        <td width="16"><img src="/include/manage/images/main/tab_20.gif" width="16" height="35" /></td>
      </tr>
    </table>
	</td>
  </tr>
</table>
  </form>
</body>
</html>